//
// Created by EDZ on 2022/1/27.
//

#ifndef BASIC_INCLUDE_H
#define BASIC_INCLUDE_H

#if defined(__clang__) || defined(__GNUC__)

#define CPP_STANDARD __cplusplus

#elif defined(_MSC_VER)

#define CPP_STANDARD _MSVC_LANG
#endif

#if CPP_STANDARD >= 199711L
#define CPP_GT_2003 1
#endif
#if CPP_STANDARD >= 201103L
#define CPP_GT_2011 1
#endif
#if CPP_STANDARD >= 201402L
#define CPP_GT_2014 1
#endif
#if CPP_STANDARD >= 201703L
#define CPP_GT_2017 1
#endif
#if CPP_STANDARD >= 202002L
#define CPP_GT_2020 1
#endif

#if CCPP_STANDARD <= 202002L
#define CPP_LT_2020 1
#endif
#if CCPP_STANDARD <= 201402L
#define CPP_LT_2014 1
#endif
#if CCPP_STANDARD <= 201103L
#define CPP_LT_2011 1
#endif
#if CCPP_STANDARD <= 199711L
#define CPP_LT_2003 1
#endif


#include <cstdio>
#include <iostream>
#include <string>

/// c++11
template<typename Forward_iterator, typename Value>
Forward_iterator
find(Forward_iterator first, Forward_iterator last, const Value &val) {
    while (first != last && *first != val)
        ++first;
    return first;
}

/// 打印仿函数 functor
class Print{
public:
    explicit Print(char flg) : flag(flg) {}
    void operator()(auto&& items) {
        for (auto &item: items) {
            std::cout << item << flag;
        }
        std::cout << "\n";
    }

private:
    char flag;
};

#endif //BASIC_INCLUDE_H
